package com.neu.constant;

public enum PlanStatusEnum {
    NORMAL(10, "正常"),
    DONE(20, "完成"),
    UNDONE(30, "未完成"),
    UNKNOWN(-1, "未知");

    public final int code;
    public final String des;

    PlanStatusEnum(int code, String des) {
        this.code = code;
        this.des = des;
    }

    public static PlanStatusEnum of(int code) {
        if (code == NORMAL.code) {
            return NORMAL;
        } else if (code == DONE.code) {
            return DONE;
        } else if (code == UNDONE.code) {
            return UNDONE;
        } else {
            return UNKNOWN;
        }
    }
}
